package com.example.Lambda;

public class TestLambda {
    public static void main(String[] args) {
        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("Swimming Done");
            }
        });

        goSwimming(() -> {
            System.out.println("Swimming Done");
        });
    }

    public static void goSwimming(Swimming swimming) {

        swimming.swim();
    }
}

interface Swimming {
    void swim();
}